<?php 
$this->menu = array(
	array('label'=>'分类管理', 'url'=>array('Admin'), 'visible'=>Yii::app()->user->v('manage@ArticleCateAdmin')),
);
if(!empty($model['_id']) && Yii::app()->user->v('manage@ArticleCateEdit')){
	$this->menu[] = array('label'=>'创建新分类', 'url'=>array('Edit'));
}

$cs = Yii::app()->clientScript;
$cs->registerScriptFile(BASE_URL . '/js/jquery_plus/jquery.form.js', CClientScript::POS_END);
//以下为百度编辑器
$cs->registerCssFile(BASE_URL . '/js/ueditor/themes/default/css/ueditor.css');
$cs->registerScriptFile(BASE_URL . '/js/ueditor/ueditor.config.js', CClientScript::POS_END);
$cs->registerScriptFile(BASE_URL . '/js/ueditor/ueditor.all.min.js', CClientScript::POS_END);
?>
<h2><a href="/manage/articlecate/admin">文章分类管理</a> / 编辑</h2>
<?php 
$this->beginWidget('CActiveForm', array(
	'id'			=> 'article_cate_form',
	'htmlOptions' 	=> array('class'=>'setting_form'),
));
?>
	<div class="setting_nav"></div>
	<dl class="setting_content">
		<dt>基本信息</dt>
		<dd>
			<strong>分类名称：</strong>
			<?php echo YHtml::activeTextField($model, 'name', array('model'=>'ArticleCate', 'rule'=>'^.{1,20}$', 'next_focus'=>''))?>
			<p>建议长度在2至10之间</p>
		</dd>
		<dd>
			<strong>上级分类：</strong>
			<?php echo YHtml::activeDropDownList($model, 'parent', ArticleCateModel::getOpts(true, '--顶级分类--'), array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>上级分类</p>
		</dd>
		<dd>
			<strong>分类代码：</strong>
			<?php echo YHtml::activeTextField($model, 'code', array('model'=>'ArticleCate', 'rule'=>'^$|[_|a-z|A-Z|0-9]{1,20}$', 'next_focus'=>''))?>
			<p>用于模块调用，请使用字母、数字及下划线，不可重复</p>
		</dd>
		<dd>
			<strong>标识：</strong>
			<?php 
			$this->widget('manage.widget.EnumsSelectorWidget', array(
				'code' => 'article_cate_flags',
				'name' => 'ArticleCate[article_cate_flags][]',
				'values' => isset($model['article_cate_flags'])?$model['article_cate_flags']:null
			));
			?>
		</dd>
		<dd>
			<strong>属性组：</strong>
			<?php echo YHtml::activeTextField($model, 'attrs', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>自定义属性组，此分类下商品的扩展属性</p>
		</dd>
		<dd>
			<strong>浏览权限：</strong>
			<?php echo YHtml::activeTextField($model, 'roles', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>可指定可浏览的用户角色，默认为公开</p>
		</dd>
		<dd>
			<strong>排序值：</strong>
			<?php echo YHtml::activeTextField($model, 'rank', array('model'=>'ArticleCate', 'next_focus'=>'', 'rule'=>'^\d+$'))?>
			<p>越小排序越靠前</p>
		</dd>
		<dt>分类描述</dt>
		<dd>
			<?php 
			$this->widget('application.widget.EditorWidget',
				array(
					'name'	=> 'ArticleCate[desc]',
					'id'	=> 'editor',
					'value' => (isset($model['desc'])?$model['desc']:''),
				)
			);
			?>
		</dd>
		<dt>分类图片</dt>
		<dd>
			<?php 
			$this->widget('manage.widget.UploaderWidget',array(
				'pictures' 	=> isset($model['pictures'])?$model['pictures']:null,
			));
			?>
		</dd>
		<dt>高级设置</dt>
		<dd>
			<strong>分类路径：</strong>
			<?php echo YHtml::activeTextField($model, 'path', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>可用于SEO优化，可使用参数</p>
		</dd>
		<dd>
			<strong>频道模板：</strong>
			<?php echo YHtml::activeTextField($model, 'tpl_index', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>指定频道页面使用模板</p>
		</dd>
		<dd>
			<strong>列表模板：</strong>
			<?php echo YHtml::activeTextField($model, 'tpl_list', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>指定列表页面使用模板</p>
		</dd>
		<dd>
			<strong>明细模板：</strong>
			<?php echo YHtml::activeTextField($model, 'tpl_view', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>指定明细页面使用模板</p>
		</dd>
		<dd>
			<strong>频道命名：</strong>
			<?php echo YHtml::activeTextField($model, 'name_index', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>频道URL名称（不包含路径）</p>
		</dd>
		<dd>
			<strong>列表命名：</strong>
			<?php echo YHtml::activeTextField($model, 'name_list', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>列表URL名称（不包含路径）</p>
		</dd>
		<dd>
			<strong>明细命名：</strong>
			<?php echo YHtml::activeTextField($model, 'name_view', array('model'=>'ArticleCate', 'next_focus'=>''))?>
			<p>明细URL名称（不包含路径）</p>
		</dd>
		<?php echo $this->renderPartial('../common/seo', array('model'=>$model));?>
	</dl>
	<div class="buttons right">
		<?php echo YHtml::activeHiddenField($model, '_id', array('model'=>'ArticleCate'))?>
		<input type="button" class="button save_btn" value="保存"/>
	</div>
<?php $this->endWidget(); ?>